package com.afei.java.ai.langchain4j.service.impl;

import com.afei.java.ai.langchain4j.entity.Appointment;
import com.afei.java.ai.langchain4j.service.AppointmentService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.afei.java.ai.langchain4j.mapper.AppointmentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Title: AppointmentServiceImpl
 * @Author wangyf
 * @Package com.afei.java.ai.langchain4j.service.impl
 * @Date 2025/4/24 17:34
 * @description:
 */

@Service
public class AppointmentServiceImpl extends ServiceImpl<AppointmentMapper, Appointment> implements AppointmentService {


    @Autowired
    private  AppointmentMapper appointmentMapper;

    @Override
    public Appointment getOne(Appointment appointment) {

        LambdaQueryWrapper<Appointment> LambdaQueryWrapper = new LambdaQueryWrapper<>();
        LambdaQueryWrapper.eq(Appointment::getUsername,appointment.getUsername());
        LambdaQueryWrapper.eq(Appointment::getIdCard,appointment.getIdCard());
        LambdaQueryWrapper.eq(Appointment::getDepartment,appointment.getDepartment());
        LambdaQueryWrapper.eq(Appointment::getDate,appointment.getDate());
        LambdaQueryWrapper.eq(Appointment::getTime,appointment.getTime ());

        Appointment appointment1 = appointmentMapper.selectOne(LambdaQueryWrapper);
        return appointment1;
    }
}
